<?php

ini_set("display_errors", 0);
error_reporting(E_ERROR | E_PARSE | E_ALL);
set_time_limit(120);
include("/var/www/www_magazooms/database.php");
include("php/mzModel.php");
include ("/var/www/www_magazooms/sanitizeCHR.php");

$timestamp = date('ymdis');
$agent =  $_SERVER['HTTP_USER_AGENT'];
$version = '4.0.0';
$agentArr = explode("(", $agent);
$agentArr = explode(")", $agentArr[1]);

$agentProps = explode(";", $agentArr[0]);
$device = strtoLower($agentProps[0]); 
$device = (strpos($agentArr[0],"Android")>0) ? "Android" : $device;

$sp = strpos($agent,"(",0);
$ep =  strpos($agent,") ",0)-1;
$platformArr =  explode(";",substr($agent, $sp+1, $ep-$sp));
$os = trim($platformArr[1]);
$platform = trim($platformArr[0]);

$sp = strpos($agent,"(",$ep-1);
$browserVersion =  trim(substr($agent, $sp));

$redirectScript = '';
$action = "loading";
$actionValue = (isset($ref)) ? "emailed" : "direct";
$urlRefer = $HTTP_REFERER;
$ID = ($_GET['mzID']) ?  $_GET['mzID'] : "130220090318" ;
$resize = $_GET['resize'] ;
$scroll = $_GET['scroll'] ;
$dbrs = $_GET['drs'];
$search = $_GET['search'];
$pageNum = $_GET['pageNum'];
$searchTxt = $_GET['search'];
$searchTOC = $_GET['toc'];
$viewMode = isset($_GET['vm']) ? $_GET['vm'] : 0;

$mzModel = implode(',',$magazoomsModel);

$mz=  $_GET['m'];

//echo $m;
//exit;


if($searchTOC){
	$topic = str_replace("-", " ", $searchTOC)	;
	$topic = str_replace("  ", " ", $topic)	;
	
	$select = "select pageSeq from toc left join magazooms on (magazooms.recordID = toc.mzID) where magazooms.seo_title='".$mz."' and replace(replace(replace(replace(replace(toc.title,' & ',' '),':',''),'\'', ' '),'-',''),'  ',' ')  like '%".$topic."%' limit 1";	
	//echo $select;
	//exit;
	$res = mysql_query($select);
	$rec = mysql_fetch_row($res);
	$pageNum = $rec[0];			
}


$user = $_GET['u'];
$opener = $_GET['o'];
$psource = $_GET['s'];
$logging = $_GET['l'];


$updateSettingsJS = ($user=='admin') ?"<script type=\"text/javascript\" src=\"js/updateSettings.js\"></script>" : "";

$whereCondition = " magazooms.recordID ='".$ID."' and magazooms.seo_title is not null";

if(isset($mz)&& $mz!=''){
	//$mz= preg_replace("/[_|-]/"," ",$m);		
	$whereCondition = " magazooms.seo_title = '".$mz."'  order by releasedate DESC limit 1";
	//$whereCondition = " magazooms.meta_title = '".$m."'";
}


$select = "select `meta_title`, `meta_description`, `meta_keywords` , `clientID` , magazooms.recordID, magazooms.paid ,accounts.status, magazooms.pubID, accounts.googleUA ,accounts.company,accounts.colorA ,accounts.colorB,accounts.backgroundStyle, accounts.toolbar3D,accounts.subdomain from magazooms left join accounts on (magazooms.clientID=accounts.recordID) WHERE ".$whereCondition;
$mzResult = mysql_query($select);


$res = $mzResult;

if(mysql_num_rows($mzResult)<1){


	$whereCondition = " magazooms.seo_title like '%".$m."%'";
	
	$select = "select `meta_title`, `meta_description`, `meta_keywords` , `clientID` ,  magazooms.recordID, magazooms.paid ,accounts.status, magazooms.pubID, ";
	$select .= "accounts.googleUA ,accounts.company,accounts.colorA ,accounts.colorB,accounts.backgroundStyle, accounts.toolbar3D,accounts.subdomain  from magazooms left join accounts on (magazooms.clientID=accounts.recordID) WHERE ".$whereCondition;
	$select .= " order by releasedate DESC limit 1";
	
	//echo $select;
	//exit;
	
	$res = mysql_query($select);
	
	if(mysql_num_rows($res)< 1){
		
		$alertScript = "<script language=javascript>";
		$alertScript .="  setTimeout(function(){alert('Sorry, the publication requested was not found.'+'\\r\\r'+'Please check your URL.')},4000)";
		$alertScript .="</script>";	
		echo $alertScript;
		exit;
	}
	
};

//exit;

while ($row = mysql_fetch_row($res)) {
	$meta_description = $row[1];
	$meta_keywords = mysql_real_escape_string($row[2]);
	$accountID = $row[3];
	$ID = $row[4];
	$paid = $row[5];
	$accountStatus = $row[6];
	$googleUA = !isset($pubID) ? $row[8] : $row[7];
	$company = !isset($pubID) ? $row[9] : $row[8];
	
	$colorA = !isset($pubID) ? $row[10] : $row[9];
	$colorB = !isset($pubID) ? $row[11] : $row[10];
	$backgroundStyle = !isset($pubID) ? $row[12] : $row[11];
	$toolbar3D = !isset($pubID) ? $row[13] : $row[12];
	$subdomain = !isset($pubID) ? $row[14] : $row[13];

	$pubID = !isset($pubID) ? $row[7] : $pubID;
	$meta_title = $row[0];
	$companyStr = preg_replace('/[\,|\']/',"",$company);
	$companyStr = preg_replace('/\s/', "-", $companyStr);
	
	//echo $companyStr;
	if (is_file('/var/www/www_magazooms/appIcons/'.$companyStr.'.png')) {
		$appIcon = $companyStr.".png";
	} else {
		$appIcon = "mzooms.png";
	}
}


$subdomain = ((!isset($subdomain) || $subdomain =='' ) || $_SERVER['SERVER_NAME']=="www.magazooms.com") ?  "http://www.magazooms.com" : "http://".$subdomain ;

if($opener==''){
	$selectOpener = "select opener,openerURL from magazines where recordID = '".$pubID."'";
	$resOpener = mysql_query($selectOpener);
	$rowOpener = mysql_fetch_row($resOpener);
	$opener = (is_File("/var/www/www_magazooms/opener/".$rowOpener[0])) ? $rowOpener[0] : "";
	$openerURL = (isset($rowOpener[1]))? str_replace("https", "http", $rowOpener[1]): "";

}
//echo $subdomain;
//exit;
	
//if(isset($colorA)){
	$acctStyles = "var acctColorA = \"".$colorA."\"\r\n";
//}
//if(isset($colorB)){
	$acctStyles .= "var acctColorB = \"".$colorB."\"\r\n";
//}
//(isset($backgroundStyle)){
	$acctStyles .= "var acctBackgroundStyle = \"".$backgroundStyle."\"\r\n";
//}
//if(isset($toolbar3D)){
	$acctStyles .= "var acctToolbar3D = \"".$toolbar3D."\"\r\n";
//}


$googleUAarr = array();

array_push($googleUAarr, 'UA-4616221-1');

$GAarr = (isset($googleUA) && $googleUA!='') ? explode(",",$googleUA) : '';

foreach($GAarr as $a){
	array_push($googleUAarr, $a);
}

$meta_keywords = strHygiene($meta_keywords);

preg_match('<keywords>' , $meta_keywords,$matches);

if(count($matches)==1){
	$keywords  = str_replace("<keywords>","",$meta_keywords);
	$keywords  = str_replace("</keywords>","",$keywords );
	$meta_keywords = $keywords;
}
	
$flashURL = "http://www.magazooms.com/reader/origIndex.php?mzID=$ID";

$cover = "http://www.magazooms.com/publish/".$accountID."/".$pubID."/packages/".$ID."/package/thumbs/".$ID."_1.gif";
$microLogo = (is_file("/var/www/www_magazooms/microLogos/".strtolower($companyStr.".png"))) ? "http://www.magazooms.com/microLogos/".strtolower($companyStr.".png") : "";
$splash = (is_file("/var/www/www_magazooms/splash/".strtolower($companyStr.".png")) && $companyStr!='') ? "/splash/".strtolower($companyStr.".png") : "";

$thisURL = $_SERVER['REQUEST_URI'];


include('/var/www/www_magazooms/browser.php');

$br = new Browser;
$platform = $br -> Platform;
$browser = $br -> Name;
$brversion = $br -> Version;
$aol = $br -> AOL;
$ip = @$REMOTE_ADDR;
if ($ip == '') {
	$ip = $_SERVER['REMOTE_ADDR'];
}
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,5);
$lang = strtolower($lang);

$dateStamp = date('Y-m-d', time());
$timeStamp = date('His', time());
$thisURL = "http://www.magazooms.com".$thisURL;


if($browser=="MSIE" && $brversion < 9){
	$redirectScript = "<script language='javascript'>\n";
	//$redirectScript .="  setTimeout(\nfunction(){\n";
	$msg = "'Sorry, this HTML5 version is not compatible with Internet Explorer ".$brversion.".\\r\\rUpdate to IE 9 or try another browser such as FireFox, Chrome, or Safari\\r";
	
	$alert = "alert(".$msg.")";
	
	$redirectScript .= $alert;		
	
	$redirectScript .="</script>";
	echo $redirectScript;
	exit;
}	

$googleA_JS = "var _gaq = _gaq || [];\r\n";

foreach($googleUAarr as $GAA){
	$googleA_JS .= "_gaq.push(['_setAccount', '$GAA']);  _gaq.push(['_trackPageview']);\r\n";
}


$googleA_JS .=  "(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'\r\n;
    /*ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/u/ga_debug.js';*/
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();";

/*	
if(stripos(strtoLower($device),"iphone")!==false ){
	
	$appResult = mysql_query($appQuery);
	
	$appRecord = mysql_fetch_row($appResult);
	$appName = ($appRecord[0]!='') ? $appRecord[0] : "/publish/".$accountID."/".$pubID."/packages/".$ID."/package/pdf/".$ID.".pdf";
	
	$redirectScript = "<script language=javascript>";
	$redirectScript .="  setTimeout(\"location.href=\'".$appName."\'\",10)";
	$redirectScript .="</script>";	
	echo $redirectScript;
	exit;
}


if(stripos($android[2],"android")!==false){
	//echo $android[2];
	//echo "Android";
	$newURL = "/publish/".$accountID."/".$pubID."/packages/".$ID."/package/pdf/".$ID.".pdf";	
	$redirectScript = "<script language=javascript>";
	$redirectScript .="  setTimeout(\"location.href='".$newURL."\'\",10)";
	$redirectScript .="</script>";	
	//echo $redirectScript;
	//exit;
}

if(stripos(strtoLower($device),"ipad") === false ){
			
	$pageParam = (isset($pageNum))? "?pageNum=".$pageNum : "";
			
	$url = $mz.$pageParam ;
	//echo $url;
	//exit;
	$redirectScript = "<script language=javascript>";
	$redirectScript .="  setTimeout(\"location.href='". $url ."'\",100)";
	$redirectScript .="</script>";	
	
	//echo $redirectScript;
	//exit;
}
*/

$mobileArr = array("iphone","ipad","linux","android");
$isMobile = in_array(strtolower($device), $mobileArr);

$appleDevice = strcmp(strtoLower($device),"ipad") == 0 || strcmp(strtoLower($device),"iphone") == 0 ;

$userscale = ($isMobile && $device!='ipad' ) ? "yes" : "no";

$metaTags = "<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=".$userscale."'>".chr(10);

if($appleDevice > 0){
	$metaTags .= '<meta name="apple-mobile-web-app-capable" content="yes">'.chr(10);
	$metaTags .= '<meta name="apple-mobile-web-app-status-bar-style" content="black">'.chr(10);
	$metaTags .= '<meta name = "apple-touch-fullscreen" content = "YES" >'.chr(10);
	$metaTags .= '<link rel="apple-touch-icon" href="'.$subdomain.'/appIcons/'.$appIcon.'" >'.chr(10);
}
else{
	$metaTags .='<link rel="shortcut icon" sizes="196x196" href="'.$subdomain.'/appIcons/'.$appIcon.'" >'.chr(10);
}


?>
<!doctype html>
<!-- <html manifest='<?php echo $subdomain; ?>/HTML5HDev/manifest.appcache' type="text/cache-manifest">  -->
<html>
<head>
<base href="<?php echo $subdomain; ?>/HTML5HDev/" >
<title><?php echo $meta_title; ?></title>
<meta charset="UTF-8">
<meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" >
<meta name="keywords" lang="en-us"  content="<?php echo $meta_keywords; ?>">
<?php echo $metaTags;?>

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta property = "og:title" content = "<?php echo $meta_title; ?>" >
<meta property = "og:type" content = "article" >
<meta property = "og:url" content = "<?php echo $thisURL; ?>" >
<meta property = "og:image" content = "<?php echo $cover; ?>" >
<meta property = "og:site_name" content = "<?php echo $company; ?>">
<meta property = "fb:fb_app_id" content = "174546709227911" >
<meta property = "og:description" content = "<?php echo $meta_description; ?>" >



<link type="text/css" id="tag" rel="stylesheet" href="css/annotations.css?ts=<?php echo  $version;?>" >
<link type="text/css" title="default" rel="stylesheet" href="css/myStyle.css?ts=<?php echo  $version;?>">	

<link type="text/css" id="textures" rel="stylesheet" href="../../CSS/textures.css?ts=<?php echo  $version;?>" >		

<!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> -->
<script src="http://code.jquery.com/jquery-1.10.2.js"></script> 


<?php echo $updateSettingsJS;?>

<!-- <script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script> -->
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="../../JS/spinner.js" ></script>


  <!-- In production, only one script (pdf.js) is necessary -->
  <!-- In production, change the content of PDFJS.workerSrc below -->
  
 <!--
 <script src="../../../PDFrender/src/shared/util.js"></script>
  <script src="../../../PDFrender/src/display/api.js"></script>
  <script src="../../../PDFrender/src/display/metadata.js"></script>
  <script src="../../../PDFrender/src/display/canvas.js"></script>
  <script src="../../../PDFrender/src/display/webgl.js"></script>
  <script src="../../../PDFrender/src/display/pattern_helper.js"></script>
  <script src="../../../PDFrender/src/display/font_loader.js"></script>
  <script src="../../../PDFrender/src/display/annotation_helper.js"></script>
  <script src="../../../PDFrender/src/display/compatibility.js"></script>
-->
  
    
  <script src="http://cdn.magazooms.com/PDFrender/src/shared/util.js?v=<?php echo $version;?>"></script>
  <script src="http://cdn.magazooms.com/PDFrender/src/display/api.js?v=<?php echo $version;?>"></script>
  <script src="http://cdn.magazooms.com/PDFrender/src/display/metadata.js?v=<?php echo $version;?>"></script>
  <script src="http://cdn.magazooms.com/PDFrender/src/display/canvas.js?v=<?php echo $version;?>"></script>
  <script src="http://cdn.magazooms.com/PDFrender/src/display/webgl.js?v=<?php echo $version;?>"></script>
  <script src="http://cdn.magazooms.com/PDFrender/src/display/pattern_helper.js?v=<?php echo $version;?>"></script>
  <script src="http://cdn.magazooms.com/PDFrender/src/display/font_loader.js?v=<?php echo $version;?>"></script>
  <!-- <script src="http://cdn.magazooms.com/PDFrender/src/display/annotation_helper.js?v=<?php echo $version;?>"></script> -->
  <script src="http://cdn.magazooms.com/PDFrender/src/display/compatibility.js?v=<?php echo $version;?>"></script>
  

  <script type="text/javascript" src="../../JS/utilities.js?v=<?php echo $version;?>" ></script>
  <script type="text/javascript" src="js/appCache.js?v=<?php echo $version;?>"></script>
   
<script>

var openPageNum = "<?php echo $pageNum; ?>"
var mzID = "<?php echo $ID;?>"
var searchTxt = '<?php echo $searchTxt;?>';
var keywords = "<?php echo $keywords; ?>";

var subdomain = "<?php echo $subdomain; ?>";
var appIcon = subdomain+"/appIcons/<?php echo $appIcon;?>";
var isMobile = "<?php echo $isMobile;?>";
var OS = "<?php echo $os;?>";

var usr ="<?php echo $user; ?>";
var logging = "<?php echo $logging;?>";
var browser = "<?php echo $browser;?>";
var browserName = "<?php echo $browserVersion;?>";
var platform = "<?php echo $platform;?>";
var opener = "<?php echo $opener;?>";
var openerURL = "<?php echo $openerURL;?>";
var psource = "<?php echo $psource;?>";
var device = "<?php echo $device;?>";
var agent = "<?php echo $agent;?>";
var viewMode = "<?php echo $viewMode;?>";
var lang =  "<?php echo $lang;?>";
var mzModel = ("<?php echo $mzModel;?>").split(',');
var resize = ("<?php echo $resize;?>");
var scroll = ("<?php echo $scroll;?>");

var gaArr = (('<?php echo implode(",",$googleUAarr);?>').split(",").length>1) ? ('<?php echo implode(",",$googleUAarr);?>').split(",") : new Array('<?php echo implode(",",$googleUAarr);?>')

<?php echo $googleA_JS ;?>

<?php echo $acctStyles;?>

var microLogo = "<?php echo $microLogo;?>"
var splash = "<?php echo $splash;?>"

setTimeout(function(){init();},2000);

</script>

<script src="js/shopping.js"></script> 
<script src="js/annotations.js"></script>
<script src="js/bandwidth.js"></script> 
<script src="js/functions.js"></script>

<script src="js/chat.js"></script>
<script src="js/search.js"></script>
<script src="js/youTube.js"></script>
<script src="js/sharing.js"></script>
<script src="js/opener.js"></script>


   


<style>

#loader{
	text-align:center;
	top:35%;
	height:300px;
	position:absolute;
	display:inline-block;
	width:100%;
	border:0px black dashed;
	left:0px;
}

.pageWrapper{
	position:relative;
	border:0px black dotted;
	display:none;
	z-index: 0;
	margin-top: 5px;
	}
.panel{
	position:relative;
	height:100%;
	border:0px red dashed;
	left:0px;
	padding:0px;
	top:-2px;
	width:100%;
}

.win{
	position:absolute;
	height:100%;
	display:none;
	border:0px red dashed;
	left:0px;
	padding:0px;
	top:0px;
}

.spreadItem{
	margin:8px;
	
}


	
.pagesPanel{
	-webkit-overflow-scrolling: touch;
	overflow-y: scroll;
	display:none;
	height:100%;
}
.tocPanel{
	-webkit-overflow-scrolling: touch;
	overflow-y: scroll;
	display:block;
	height:100%;
	margin-top:3px;
	background-color: #eeeeee;
}
.shoppingPanel{
	-webkit-overflow-scrolling: touch;
	overflow-y: scroll;
	display:none;
	height:100%;
}
.archivePanel{
	-webkit-overflow-scrolling: touch;
	overflow-y: scroll;
	display:none;

}
.searchPanel{
	-webkit-overflow-scrolling: touch;
	overflow-y: scroll;
	display:none;

}
.contactPanel{
	-webkit-overflow-scrolling: touch;
	overflow-y: scroll;
	display:none;

}
#pageCanvas{
	position:absolute;
	display:none;
	border:0px green dashed;
	background-color: #ffffff;
	-webkit-overflow-scrolling: touch;
	overflow-y: scroll;
}

#annotDiv{
	position:absolute;
	display:block;
	border:0px green dashed;
	-webkit-overflow-scrolling: touch;
	overflow-y: scroll;
	z-index: 20000006;
}
#viewport{
	display:none;
	overflow-y: scroll;
	-webkit-overflow-scrolling: touch;
	position:absolute;
	top:35px;
}
#topToolbar{
	height:35px;
	background-color:#202020;
	display:none;
	position:absolute;
	font-size: 1em;
	line-height: 35px;
}


.optionsDiv{
	height:0px;
	top:0px;
	position: relative;
}

</style>

</head>

<body style='text-align:center;margin:0px;'  >

	<div class="progressText initLoaderBox">...initializing</div>
	<div class='initLoaderBox' style='top:20%;'>
	<div class= 'progressDiv' >
		
		
		<h2 id='title' class='textShadow' style='color:#ffffff;'></h2>
	</div>
	</div>
	
<div class='win'>
	
	<div id='topToolbar'>
		<div class='buttonObject menu ShowMenu' data-object="slidePanel()" title='' style='position:absolute;left:10px;width:40px;'></div>
		<div id="cartTD" style="text-align:right;border:0px white dotted;position:absolute;left:60px;width:150px;padding:0px;" class='ecommerce '></div>
		<div class='cartCallout numberCallout ecommerce' style='position:absolute;left:212px;' ></div>
		<div class="pubTitle" ></div>
		
		<div id="topbarSpinnerDiv" ></div>
		
		 <div id='resizer'>
		 		 <div data-object='resizePages(0)' title='' class='buttonObject psizers psize1 '></div>						
		 		 <div data-object='resizePages(2)' title='' class='buttonObject psizers psize3 '></div>
	 		 </div>
	 		 
		<div id="searchIcon" class='searchIcon buttonObject iconProp' style="position:absolute;top:0px;right:80px;" data-object="showAccordion('searchPanel');slidePanel()" ></div>
		
		<div id="flagsTD" class='toolbarDivs' style="position:absolute;top:0px;right:10px;width:40px;height:30px;"></div>
	</div>
	<div id='viewport'>
		
		<div class='pageWrapper'>
			<canvas id="pageCanvas"></canvas>
			<div id="annotDiv"></div>
			
		</div>
		
	</div>
	
	<div ignore="1" class="next-button buttonObject" data-object='nextpage()'>
			<div  title="go to next page" style='top:50%;' data-object='nextpage()' class="arrowright" ></div> 
	</div>
		<!-- Previous button -->
	<div ignore="1" class="previous-button buttonObject" data-object='prevpage()'>
		<div title="go to previous page"  style='top:50%;' data-object='prevpage()' class="arrowleft" ></div>
	</div>
	<div id="languagesDiv" >
		<img src = "images/flags/cs-cz.png" class='cs-cz buttonObject flagIcon langIcon' style='width:25px;height:25px;' data-object='selectLanguage(event)'>
		<img src = "images/flags/de-de.png" class='de-de buttonObject flagIcon langIcon' style='width:25px;height:25px;' data-object='selectLanguage(event)'>
		<img src = "images/flags/en-us.png" class='en-us buttonObject flagIcon langIcon' style='width:25px;height:25px;' data-object='selectLanguage(event)'>
		<img src = "images/flags/es-es.png" class='es-es buttonObject flagIcon langIcon' style='width:25px;height:25px;' data-object='selectLanguage(event)'>
		<img src = "images/flags/fr-fr.png" class='fr-fr buttonObject flagIcon langIcon' style='width:25px;height:25px;' data-object='selectLanguage(event)'>
	</div>




	<div class ='panel'>
		<div class='panelHead buttonObject'>
			<div class='panelTitle accordionHeader blackSand' >
			<div class='companyIcon'></div>
			<div class='company'></div>
		</div>
		<div class="optionsDiv blackSand " title='' style='left:0px;z-index:1900;'>
			
						<ul style='position:relative;left:5px;top:0px;width:90%'>
						<li class='buttonObject T2 TableOfContentsLabel tocIcon iconProp' title= '' data-object="showAccordion('tocPanel')">Table of Contents &#57349;</li>
						<li class='buttonObject T2 labelLabel iconProp' title= '' data-object="showAccordion('labelPanel')">Label</li>
						<li class='buttonObject T2 SearchLabel searchIcon iconProp' title='' data-object="showAccordion('searchPanel')">Search</li>
						<li class='buttonObject T2 PagesLabel pagesIcon iconProp' title= '' data-object="showAccordion('pagesPanel')">Pages</li>
						<li class='buttonObject T2 ecommerce ShoppingCartLabel cartIcon iconProp' title= '' data-object="showAccordion('shoppingPanel')">Shopping Cart</li>
						<li class='buttonObject T2 TagLabel iconProp' title= '' data-object="showAccordion('tagsPanel')">Special Tags</li>

						<li class='buttonObject T2 ShareLabel shareIcon iconProp' title= '' data-object="showAccordion('sharePanel')">Share</li>
						<li class='buttonObject T2 SaveLabel saveIcon iconProp' title= '' data-object="showAccordion('savePanel')">Save</li>
						<li class='buttonObject T2 ArchivesLabel Archives archiveIcon iconProp' title= '' data-object="showAccordion('archivePanel')">Archives</li>
						<li class='buttonObject T2 VideosLabel YouTube videoIcon iconProp' title= '' data-object="showAccordion('youTubePanel')">Videos</li>
						<li class='buttonObject T2 ContactUsLabel contactIcon iconProp' title= '' data-object="showAccordion('contactPanel')">Contact Us</li>
						<li class='buttonObject T2 AboutLabel aboutIcon iconProp' title= '' data-object="showAccordion('aboutPanel')">About</li>
						<li class='buttonObject T2 SettingsLabel settingsIcon iconProp' title= '' data-object="showAccordion('settingsPanel')">Settings</li>
						<li class='buttonObject T2 HelpLabel helpIcon iconProp' title= '' data-object="showAccordion('helpPanel')">Help</li>
						</ul>
			</div>
		
		</div>
		
		<div class='tocPanel accordionItem graySand panelItem' style="margin-bottom:-5px;">
			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '></div>
			<div class="tocContents content panelContent"></div>				
			
		</div>
		
		<div class='pagesPanel accordionItem panelItem graySand' style="margin-top:1px;margin-bottom:-17px;">
			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '></div>
			<div class="pagesContent content panelContent"></div>
		</div>
		
		<div class='labelPanel accordionItem panelItem graySand' style="margin-top:1px;margin-bottom:-17px;">
			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '></div>
			<div class="labelContent content panelContent"></div>
		</div>

    	<div class='searchPanel accordionItem graySand panelItem' >
    		<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
    		<div class='panelText '></div>
			<div class="searchContents content panelContent">
				<div id="searchDiv" style='position:relative;top:0px;'>
					<input id='searchInput' type='text' value='search'  class='buttonObject' data-object='clearInput(event)'  onkeyup=autoSubmit(event,'searchNow') >
				</div>
				<div id='searchSave' ></div>	
				<div id="contentDivSearchResults" style='height:100%;' class='panelContent content'></div>
			</div>
		</div>
	
    	<div class='shoppingPanel accordionItem graySand panelItem' >
    		<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='MyCartMyInterest'>
			<button class='MyCart button' data-object="toggleMyCart('cart')"></button>
			<button class='MyInterest button' data-object="toggleMyCart()"></button>
			<div class='numberCallout interestCallout'></div>
			</div>

			<div class="shoppingContents content panelContent">
				<div class='shoppingHeader'></div>				
				<div class='cartHeader' ></div>
				<div id="cartContentDiv">			
					<div id="currentCartDiv"></div>
				</div>
				<div id="cartFooter" ></div>
			</div>
			<div class="interestContents content panelContent">
			</div>				
		</div>	
	
		<div class='savePanel accordionItem graySand panelItem' >
			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '></div>
			<div class='panelContent saveContent content' >
				<div style='width:80%;margin-left:10%;'>
					<a href='' class='downloadFull shareButton'><div  class="Save SaveAll button shareButton" ></div></a>
					<a href='' class='downloadPage shareButton'><div  class="Save SavePage button shareButton" ></div></a>
				</div>
			</div>
		</div>
		
		<div class='sharePanel accordionItem graySand panelItem' >
			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '></div>
			<div class='panelContent shareContent content' style='width:80%;' >
				<button  class="buttonObject button shareButton Share_PageView" data-object="share(0)"title=''>View</button>	
				<button  class="buttonObject button shareButton Share_App" title='' data-object="share(3)">Publication</button>	
				<button  class="buttonObject button shareButton Share_Page" title='' data-object="share(1)">Page</button>
				<button  class="buttonObject button shareButton Share_All_Pages" title='' data-object="share(2)">All Pages (PDF)</button>		
				<button  class="buttonObject button shareButton Post_to_Facebook" title='' data-object="share(4)">Facebook</button>
				<button  class="buttonObject button shareButton Post_to_Twitter" title='' data-object="share(5)">Twitter</button>
			</div>
		</div>

		<div class='tagsPanel accordionItem graySand panelItem' >
			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '></div>
			<div class='panelContent content tagContent' style='height:200px;'></div>
		</div>
		
		<div class='archivePanel accordionItem graySand panelItem' >
			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '></div>
			<div class='panelContent content archiveContent' ></div>
		</div>
		
		<div class='aboutPanel accordionItem graySand panelItem'>
			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '></div>
			<div class= 'panelContent aboutContent'></div>
  		</div>
  		
  		<div class='contactPanel accordionItem graySand panelItem'>
  			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '></div>
			<div class= 'panelContent content contactContent'>
			<table class='contactUsTable' style="border-collapse:collapse; width:100%; padding:4px; overflow:hidden;">
				<tr><td><h3 class="EmailLabel"></h3><input id='contactEmail' type="email" size=30 style='width:220px; height: 20px;'/></td></tr>
				<tr><td></td></tr>
				<tr><td><h3 class="YourComment"></h3></td></tr>
				<tr><td><textarea id='comment' ></textarea></td></tr>
				<tr><td></td></tr>
				<tr><td><button  style='height: 40px;' data-object="sendComment()" class="button ContactUsSendBtn"></button>
				</td></tr>
				</table>
			<div id="contactInfo" class="contactInfo"></div>
			</div>
  		</div>
  		
  		<div class='youTubePanel accordionItem graySand panelItem'>
  			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '>
				<div class='panelCallout numberCallout' style='position:relative;left:0px;max-width:30px;top:5px;' ></div>
			</div>
			<div class= 'panelContent youTubeContent'>
			 	<div id='youTubeContent' class="content"></div>
			</div>
  		</div>
  		
  		<div class='settingsPanel accordionItem graySand panelItem'>
  			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '></div>
			<div class= 'panelContent settingsContent'>
			 	<div id='settingsContent' class="content">
			 	<table style='width:90%;margin-left:5%;text-align:right;border:0px white solid;'>
				 	
				 	<tr>
				 	<td style='width:50%;' class='setting modeLabel'>HD Quality</td>
				 	<td style='width:50%;text-align:center;'><div class='settingMode offButton buttonObject' id="pageFormat" data-object=toggleSettings(event)></div></td>
				 	</tr>
				 	<tr>
				 	<td class='setting saveSettingsLabel'>Save Settings</td>
				 	<td style='text-align:center;'><div class='saveSettings offButton buttonObject' id='saveSettings' data-object=toggleSettings(event)></div></td>
				 	</tr>
				 	<tr>
				 	<td style="padding-top:20px;text-align:center;" colspan="2" class='SettingsInstructions'></td>
				 	</tr>
				 	<tr style="padding-top:20px;text-align:center;" >
				 	<td colspan='2' class='setting'><span class='EmailLabel'></span>&nbsp;<input id='userEmail' style="width:60%;" ></td>
				 	</tr>
				 	<tr>
				 	<td style='padding-top:10px;text-align:center;' colspan='2'><button class='button RegisterLabel'></button></td>
				 	</tr>

			 	</table>
			 	</div>
			</div>
  		</div>
  		
  		<div class='helpPanel accordionItem graySand panelItem'>
  			<button class='buttonObject button back' data-object='hideAccordion()'>back</button>
			<div class='panelText '></div>
			<div class= 'panelContent helpContent'>
			 	<div id='helpContent' class="content"></div>
			</div>
  		</div>


  		
  	</div>
		
</div>
		<div id="youTubeDiv" >
			<div id="youTubeDivHeader" class='close'><img class='buttonObject' data-object="showHideYouTubeWindow('none')" title="hide this window"  src='images/close.png'></div>
			<div id="youTubeDivContent"></div>
		</div>
	
		<div id="loadspinnerDiv"></div>
		
		<div class="openerDiv rounded"></div>
		<div id="productPopUpDiv"  ></div>
		<div id="alertDiv" class="alert dropshadow" >
			
			<div class='alertContent'></div>
			<div class='alertOptions'>
				<div class='buttonObject opt1 opts' data-object='a'></div>
				<div class='buttonObject opt2 opts' data-object='b'></div>
			</div>
			<div class='alertMore'></div>
		</div>
		
		<div id="toolTipDiv" ></div>
		<div id="spark"></div>
		<div id="spinnerDiv"></div>
		<div class="progressBar"></div>
		
		<table class='indicatorDiv' border=0><tr>
			<td style='width:54px;height:23px;' class='arrowleftsolid double buttonObject FirstPage' data-object='firstpage()'></td>
			<td style='width:60px;height:23px;' class='arrowleftsolid buttonObject' data-object='prevpage()'></td>
			<td style='width:120px;'><div id='pageIndicator'>page</div></td>
			<td style='width:60px;height:23px;' class='arrowrightsolid buttonObject' data-object='nextpage()'></td>
			<td style='width:52px;height:23px;' class='arrowrightsolid double buttonObject LastPage' data-object='lastpage()'></td>
		</tr></table>
		
		
</body>

</html>
